var Main = Backbone.View.extend({
	el: 'body',
	ix: '',
	
	initialize: function() {
		this.tablesView = new TablesView({id: 'menu'});
	},
	
	render: function () {	
		this.$el.empty();
		this.tablesView.fetch();
		this.$el.append(this.tablesView.el);
	},
	
	getTableById: function(id){
		this.ix = id;
		return _.find(this.tablesView.collection.models,
			function(num){
				if(num.get('TableID') == this.ix){
					return num;	
				}
			}, this);
	}
	/*
	getTableById: function(id){
	return this.tablesView.collection.find( 			
		function(num){
				return num.get('tableId') === this.id;	
		});
	}*/
});